/*
 * @Author: ZhanXie
 * @Date: 2020-01-06 09:27:17
 * @LastEditors  : ZhanXie
 * @LastEditTime : 2020-01-06 10:39:14
 * @Description: 游戏 model 层
 * @FilePath: /projectStudy/jumpGame/src/game/model.js
 */
import Event from '../utils/event'

class GameModel {
  constructor() {
    this.stage = '' // 当前页面切在哪个场景下
    this.stageChange = new Event(this)
  }

  /**
   * 获取当前场景
   */
  getStage() {
    return this.stage
  }

  /**
   * 设置当前场景
   */
  setStage(stage) {
    this.state = stage
    this.stageChange.notify({
      stage
    })
  }
}

export default new GameModel()